<style type="text/css">
html
{
width: 300px;
}
#gis_location_lat, #gis_location_lon { display: none }; 
</style>
<h1>{{=T("Sahana Eden")}}</h1>
<h2>{{=T("Mobile Basic Assessment")}}</h2>
{{=form}}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js" type="text/javascript"></script>
<script src="/{{=appname}}/static/scripts/web2py/web2py.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">//<![CDATA[
function getCurrentPosition(position) {
    // http://dev.w3.org/geo/api/spec-source.html
    var lat = position.coords.latitude;
    var lon = position.coords.longitude;
    //var elevation = position.coords.altitude;
    //var ce = position.coords.accuracy;
    //var le = position.coords.altitudeAccuracy;
    //position.coords.heading;
    //position.coords.speed;
    $('#gis_location_lat').val(lat);
    $('#gis_location_lon').val(lon);
};
$(function() {
	jQuery('input.double').keyup( function() {
        this.value = this.value.reverse().replace(/[^0-9\-\.]|[\-](?=.)|[\.](?=[0-9]*[\.])/g, '').reverse();
     });
	if (navigator.geolocation) {
	    // HTML5 geolocation is available :)
	    navigator.geolocation.getCurrentPosition(getCurrentPosition);
	} else {
        // geolocation is not available...IE sucks! ;)
    }
});
//]]></script>